﻿/// <reference path="../../../extjs/ext-all-debug.js" />
Ext.define('yzmh.view.collect.Xemh', {
    extend: 'Ext.Panel',
    alias: 'widget.xemh',
    closable: true,
    title: '',
    layout: 'border',
    tbar: [
        {
            xtype: 'combo',
            name: 'id',
            fieldLabel:'类型',
            typeAhead: true,
            displayField: 'name',
            valueField: 'value',
            store: Ext.create("Ext.data.ArrayStore", {
                fields: ['name','value'],
                data: [['全部', ''], ['少年热血', '4'], ['少女爱情', '5'], ['爆笑喜剧', '9'], ['科幻魔幻', '7'], ['武侠格斗', '6'], ['竞技体育', '8'], ['侦探推理', '10'], ['恐怖灵异', '11'], ['耽美BL', '12'],
                    ['日本', '14'], ['韩国', '15'], ['欧美', '16'], ['大陆', '17'], ['港台', '18'],
                    ['A', '19'], ['B', '20'], ['C', '21'], ['D', '22'], ['E', '23'], ['F', '24'], ['G', '25'], ['H', '26'], ['I', '27'], ['J', '28'], ['K', '29'], ['L', '30'], ['M', '31'], ['N', '32'], ['O', '33'], ['P', '34'], ['Q', '35'], ['R', '36'], ['S', '37'], ['T', '38'], ['U', '39'], ['V', '40'], ['W', '41'], ['X', '42'], ['Y', '43'], ['Z', '44'],

                ]
            }),
            labelWidth: 50,
            labelAlign: 'right',
            width:150,
            forceSelection: true,
            editable: false,
            queryMode: 'local'
        },
        {
            xtype: 'combo',
            name: 'io',
            fieldLabel: '状态',
            typeAhead: true,
            displayField: 'name',
            valueField:'value',
            store: Ext.create("Ext.data.ArrayStore", {
                fields: ['name','value'],
                data: [['全部', ''], ['连载', '0'], ['完结', '1']]
            }),
            labelWidth: 50,
            labelAlign: 'right',
            width: 120,
            forceSelection: true,
            editable: false,
            queryMode: 'local'
        },
        {
            xtype: 'combo',
            name: 'of',
            fieldLabel: '排序',
            typeAhead: true,
            displayField: 'name',
            valueField: 'value',
            store: Ext.create("Ext.data.ArrayStore", {
                fields: ['name', 'value'],
                data: [['最近更新', 'comicupdate'], ['最多观看', 'hitsweek'], ['用户评分', 'scorecount']]
            }),
            labelWidth: 50,
            labelAlign: 'right',
            width: 120,
            forceSelection: true,
            editable: false,
            queryMode: 'local'
        },
        { xtype: 'tbfill' }, { action: 'checkComic', text: '检测漫画', icon: 'extjs/icons/book_link.png' }, "-", { action: 'importComic', text: '导入漫画', icon: 'extjs/icons/book_add.png' },"-", { action: 'importChapter', text: '导入章节', icon: 'extjs/icons/page_add.png' }
    ],
    items: [{
        xtype: 'grid',
        store: 'collect.Xemh',
        loadMask: true,
        columnLines: true,
        forceFit: true,
        region: 'center',
        sortableColumns: false,
        viewConfig: {
            trackOver: false,
            stripeRows: true
        },
        selType: 'rowmodel',
        selModel: Ext.create("Ext.selection.RowModel", {
            mode: 'SINGLE'
        }),
        columns: [{
                xtype: 'rownumberer',
                align: 'center'
            },
            { header: '漫画名称', dataIndex: 'mhmc' },
            { header: '作者名称', dataIndex: 'zzmc', width: 50 },
            {
                header: '状态', dataIndex: 'zt', width: 20
            },
            {
                header: '漫画地址', dataIndex: 'mhurl', width: 160
            },
            { header: '章节名称', dataIndex: 'zjmc', width: 50 },
            { header: '更新时间', dataIndex: 'date', align: 'center', width: 50 },
            {
                action: 'view',
                xtype: 'actioncolumn',
                width: 20,
                header: '预览',
                align: 'center',
                icon: 'extjs/icons/page_link.png'
            },
            {
                header: '存在',
                width: 20,
                align: 'center',
                dataIndex: 'exist',
                xtype: 'booleancolumn',
                trueText: '是',
                falseText: '否'
            }
        ],
        bbar: {
            xtype: 'pagingtoolbar',
            store: 'collect.Xemh',
            displayInfo: true,
            displayMsg: '显示数据 {0} - {1} of {2}',
            emptyMsg: "没有查询到数据"
        }
    }, {
        xtype: 'panel',
        layout: 'vbox',
        region: 'east',
        border: false,
        hidden:true,
        items: [{
            xtype: 'propertygrid',
            width: 300,
            source: { }
        }, {
            name: 'chaptergrid',
            xtype: 'grid',
            width: 300,
            flex: 1,
            columnLines: true,
            forceFit: true,
            store: {
                stype: 'store',
                model: 'yzmh.model.Chapter',
                groupField: 'type'
            },
            selType: 'rowmodel',
            selModel: Ext.create("Ext.selection.RowModel", {
                mode: 'MULTI'
            }),
            features:[Ext.create('Ext.grid.feature.Grouping', {
                groupHeaderTpl: '{name} ({rows.length} 条记录)',
                hideGroupedHeader: true,
                startCollapsed: false
            })],
            columns: [
                { header: '名称', dataIndex: 'zjmc', width: 50 },
                {
                    header: '地址', dataIndex: 'zjurl'
                }]
            }]
        }]
});

